/* eslint valid-jsdoc: "off" */

'use strict';
//服务配置
const cluster = require('./cluster')

//内置框架
const multipart = require("./multipart");

//ORM model 链接数据库配置
const sequelize = require("./sequelize");

//数据验证
const validate = {
  convert: true,
  widelyUndefined: true
};

//注意这是关于跨域的 CORS
const security = {
  // 关闭csrf验证
  csrf: {
    enable: false
  },
  // 白名单
  domainWhiteList: ["*"]
};

// session配置
const session = require("./session");

// add your middleware config here
const middleware = [];

 // add your user config here
const userConfig = {
  // myAppName: 'egg',
};


module.exports = (appInfo) => {

  // use for cookie sign key, should change to your own and keep security
  const keys = appInfo.name + 'wczix';

  return {
    ...userConfig,
    multipart,
    sequelize,
    validate,
    security,
    session,
    middleware,
    keys,
    cluster
  };
};
